package com.bw.liuyushan.mvp_lib.Presenter;

import com.bw.liuyushan.mvp_lib.Model.IModel;
import com.bw.liuyushan.mvp_lib.View.IView;

import io.reactivex.disposables.Disposable;

/**
 * Liuyushan20210929
 * file name is : BasePresenter
 * created by Ender on 2021/9/29 13:37.
 * author : &#x5218;&#x96e8;&#x6749;
 * Describe:
 */
public class BasePresenter<M extends IModel,V extends IView> implements IPresenter {
    protected M mModel;
    protected V mView;
    Disposable disposable;//RxJava防止内存泄露

    public BasePresenter(M mModel, V mView) {
        this.mModel = mModel;
        this.mView = mView;
    }

    @Override
    public void Destory() {//RxJava防止内存泄露
        if (disposable!=null){
            disposable.dispose();
            disposable=null;
        }
    }
}
